package com.binarycube.webserver.datasource;

import java.sql.Timestamp;

public class Parameter {

	public enum Type {
		LONG, TIMESTAMP, INTEGER, STRING;
	}
	
	String _name;
	String _value;
	Type _type;
	
	public Parameter(String name, String val, Type type) {
		_name = name;
		_value = val;
		_type = type;
	}
	
	public Parameter(String name,String val) {
		this(name, val, Type.STRING);
	}
	
	public String getStringValue(){
		return _value;
	}
	
	public Integer getIntegerValue(){
		return Integer.valueOf(_value);
	}
	
	public Long getLongValue(){
		return Long.valueOf(_value);
	}

	public Timestamp getTimestampValue(){
		return Timestamp.valueOf(_value);
	}
	
	public String getName(){
		return _name;
	}
	
	public void setType(Type t) {
		_type = t;
	}
	
	public Type getType(){
		return _type;
	}
	
}
